package rc;

public class Employee extends Thread
{
	public Bank bank;
	public int from, to, amount;

	public Employee(Bank bank, int from, int to, int amount)
	{
		this.bank = bank;
		this.from = from;
		this.to = to;
		this.amount = amount;
	}

	@Override
	public void run()
	{
		// perform transfer
		bank.transfer(from, to, amount);

		// show balances
		synchronized (bank) {
			System.out.println("After:");
			bank.showBalances();
		}
	}
}